package com.power.leopard.remote.common.codec;

import java.io.InputStream;
import java.io.OutputStream;

import javax.sql.rowset.serial.SerialException;

import com.power.leopard.common.exception.SerializationException;
import com.power.leopard.remote.common.domain.InvocationRequest;
import com.power.leopard.remote.common.domain.InvocationResponse;
import com.power.leopard.remote.provider.domain.InvokerContext;

public interface Serializer {

	Object deserializeRequest(InputStream is) throws SerialException;

	void serializeRequest(OutputStream os, Object obj) throws SerialException;

	Object deserializeResponse(InputStream is) throws SerialException;

	void serializeResponse(OutputStream os, Object obj) throws SerialException;
	
	InvocationResponse newResponse() throws SerializationException;

	InvocationRequest newRequest(InvokerContext invokerContext) throws SerializationException;

}
